package org.example.batch.controller;

import org.example.batch.model.BatchSubTaskDto;
import org.example.batch.service.BatchSubTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 子任务web接口
 *
 * @author hero生仔
 * @date 2025/7/26
 */
@RestController
@RequestMapping("/batchsubtask")
public class BatchSubTaskController {

    @Autowired
    private BatchSubTaskService batchSubTaskService;

    @PostMapping("/putDatas")
    public void batchSubTask(@Valid @RequestBody BatchSubTaskDto batchSubTaskDto) throws InterruptedException {
        batchSubTaskService.handleBatchSubTask(batchSubTaskDto);
    }
}
